package com.chance.cc.crawler.prod.command.trigger.domain.vm.xcar.realtime;

import com.chance.cc.crawler.core.CrawlerJob;
import com.chance.cc.crawler.core.downloader.HttpPage;
import com.chance.cc.crawler.meta.core.bean.CrawlerMetaConstant;
import com.chance.cc.crawler.prod.command.job.domain.vm.xcar.realtime.XcarSeriesDiscountsRealtimeCrawlerScheduleJob;
import com.chance.cc.crawler.prod.command.trigger.CommonCrawlerSchedulerTrigger;

/**
 * @ClassName song
 * @Description TODO
 * @Author ding
 * @Date 2021/8/29 10:11
 * @Version 1.0
 * 爱卡经销商采集
 **/
public class XcarSeriesDiscountScheduleTrigger extends CommonCrawlerSchedulerTrigger {


    public static void main(String[] args) {
        publishXcarSeriesArticleRealtimeScheduleTriggerInfo();
        //publishXcarSeriesArticleRealtimeScheduleTriggerInfoTest();//测试
    }

    public static void publishXcarSeriesArticleRealtimeScheduleTriggerInfoTest(){
        CrawlerJob crawlerJob = XcarSeriesDiscountsRealtimeCrawlerScheduleJob.xcarCwalerJob();
        HttpPage page = metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                XcarSeriesDiscountsRealtimeCrawlerScheduleJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Simple,
                "",
                "爱卡汽车页车系经销商 测试");
        System.out.println("添加采集调度： "+page.getRawText());
    }

    public static void publishXcarSeriesArticleRealtimeScheduleTriggerInfo(){
        CrawlerJob crawlerJob = XcarSeriesDiscountsRealtimeCrawlerScheduleJob.xcarCwalerJob();
        HttpPage page = metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                XcarSeriesDiscountsRealtimeCrawlerScheduleJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 30 18 * * ?",   //TODO 具体采集时间未定
                "爱卡汽车页车系经销商  每天2点定时采集");
        System.out.println("添加采集调度： "+page.getRawText());
    }
}
